#ifndef _LIQUIDCRYSTAL_H_
#define _LIQUIDCRYSTAL_H_

#include <inttypes.h>
#include "Print.h"

class LiquidCrystal : public Print {
public:
  LiquidCrystal();
  LiquidCrystal(uint8_t enable, uint8_t sclk, uint8_t data_rs);
  LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);
  LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable, uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
  
  void clear();
  void home();
  void setCursor(int col, int row); 
  virtual void write(uint8_t value);
  void command(uint8_t value);
  
protected:
  
  void initlcd();
  void send(uint8_t value, uint8_t mode);

  uint8_t _rw_pin; // LOW: write to LCD.  HIGH: read from LCD.
  uint8_t _enable_pin; // activated by a HIGH pulse.
  uint8_t _sclk_pin; // Shift register clock activated by a HIGH pulse.
  uint8_t _data_rs_pin; // Shift input.
  
  uint8_t _mode; // 0=four_bit 1=eight_bit 2=serial
  uint8_t _data_pins[8];
};

#endif
